/**
 * Setvor project
 */
package setvor.lang;

/**
 * This is a representation of set with simple and basic functions
 * 
 * @author julatec
 *
 */
public interface SetOf<T> extends Iterable<T>{

	/**
	 * Return a new set with the elements of this set and the 
	 * elements of the other set.
	 * @param other, the set that need add elements.
	 * @return new Set.
	 */
	SetOf<T> union(SetOf<T> other);
	
	/**
	 * Return a new set with the elements of this set that is
	 * contained in the other set
	 * @param other, the set that need intersect elements. 
	 * @return new Set.
	 */
	SetOf<T> intersecction(SetOf<T> other);
	
	/**
	 * Optional, return the complement of this set
	 * but this method needs a universe set definition.
	 * @return the complement of this set.
	 */
	SetOf<T> complement();
	
	/**
	 * Test if an object is contained in this set.
	 * @param object, the object that need test if is contained in this set.
	 * @return true if is contained, otherwise false.
	 */
	boolean contains(T object);
	
}
